UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3RreI5ZKFZ8wtWTvm24hcsEiBr44KT17oOiM9dLv5/A='
WHERE
key_id = 'c932edb05c91b469250ce4148a0b22965a53c474a58e28b4407c9658dc9cd693'
AND (
token = '3RreI5ZKFZ8wtWTvm24hcsEiBr44KT17oOiM9dLv5/A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)