UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fPHn4WUeW2t/7CeTjgQkZC/jWFEY4uHE+ma6r0sMIiY='
WHERE
key_id = '0eff31ac5b6486959423dbdd7f734a54c84602c619722bd163b4d255b3382000'
AND (
token = 'fPHn4WUeW2t/7CeTjgQkZC/jWFEY4uHE+ma6r0sMIiY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)