UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HQbVX/0YgGT4E477TvxOW4+FwDQSqawSkcXxvDUcCys='
WHERE
key_id = '2900b37573ca995326d439488b540b6719f0feac14c8b5a040178f301778e090'
AND (
token = 'HQbVX/0YgGT4E477TvxOW4+FwDQSqawSkcXxvDUcCys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)