UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ua+DVVSQa45QrqnezPHUx626WE8y+6pcZDBoDq+AN6U='
WHERE
key_id = '538bdd1c5a9261dae746be8f292044a95698fbdb6ad915d47da698518cfc8555'
AND (
token = 'Ua+DVVSQa45QrqnezPHUx626WE8y+6pcZDBoDq+AN6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)