UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7b0hSB1GMs9zu5gLDLWmGfqYG0oiDOX9kBgJrJfZ4ro='
WHERE
key_id = 'c25a8887997d28910cf7cb035e9e2b4800ae7a4b105a91ef19437cae3df06ed2'
AND (
token = '7b0hSB1GMs9zu5gLDLWmGfqYG0oiDOX9kBgJrJfZ4ro='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)