UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xR0/6tf6DLAOXtdanht9my08U8sY+s5lM24qpzVxzto='
WHERE
key_id = 'dba9600a38ea5db7e7876a533da225aed36fe8f059e5144e1f50753f117d3802'
AND (
token = 'xR0/6tf6DLAOXtdanht9my08U8sY+s5lM24qpzVxzto='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)