UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WzztJSofk8zaazUzcCJfSITrvyrWBnS1nllkyVQtbhE='
WHERE
key_id = 'bc44ea2db2ebbfb632cf122bf6835aab0e1553d815b91fe26f5c3844fa0aa222'
AND (
token = 'WzztJSofk8zaazUzcCJfSITrvyrWBnS1nllkyVQtbhE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)