UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P8w4XQl6wVZ27UAFU1g8qEB/0x7p1n4thLxN+T830EE='
WHERE
key_id = 'ec24458fad1bc71aba1b48a4e5fb2a8bf8f838229c87e05bd8c8200a9512b074'
AND (
token = 'P8w4XQl6wVZ27UAFU1g8qEB/0x7p1n4thLxN+T830EE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)