UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RuB0EsD7OWN04Xl5v9iSzdhPiB/W7pVsB5NssCa9j4Y='
WHERE
key_id = '12f2cbb722ced7b209e5fa0e6eabadabff1b3d8d91be1a01aab78a01f67c3a62'
AND (
token = 'RuB0EsD7OWN04Xl5v9iSzdhPiB/W7pVsB5NssCa9j4Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)