UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cjlxctYTLMSG12ZHPWhcwV6dV8DskpVa5oeFm62BMwg='
WHERE
key_id = '796eafb84ca1e85de69107350c151fc40ea3fb76ae0855b89947930dc57584e1'
AND (
token = 'cjlxctYTLMSG12ZHPWhcwV6dV8DskpVa5oeFm62BMwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)