UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DLyzgDEMJfWbs7jH4JirwVF2e9jZLvnGwrsSr/DFR1I='
WHERE
key_id = 'be8a62268e6839ef92519649485aeb4584080b53036745c35e0fac24cf050872'
AND (
token = 'DLyzgDEMJfWbs7jH4JirwVF2e9jZLvnGwrsSr/DFR1I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)