UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qXWuAPEBjRzyMm0EfFXMoxCH21KAKsK9YpbCBp4sfvA='
WHERE
key_id = 'f2f1644d34565abf3e97e509082b35319ee900c0dd57dcd10488328455c7e5ed'
AND (
token = 'qXWuAPEBjRzyMm0EfFXMoxCH21KAKsK9YpbCBp4sfvA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)