UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eZl93L8z6BWfoY8xrvvaW2zb10oSdD2NTuR/D0Zyst8='
WHERE
key_id = 'b7216961f193b745d6a4e95a1831471df23e5e76b3e47dbacb2850ad6a22e5d3'
AND (
token = 'eZl93L8z6BWfoY8xrvvaW2zb10oSdD2NTuR/D0Zyst8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)