UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JTASP6WnG1XOl+OvAQfl2yKNUvkJPD4UYaPnTECwUE0='
WHERE
key_id = 'e1a362a9ac30591d346bf75121db31a2ac5a73a5a6bd22e6947d2a439e7d962a'
AND (
token = 'JTASP6WnG1XOl+OvAQfl2yKNUvkJPD4UYaPnTECwUE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)