UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OC6hl4AQmmFqYIhrUi3bl+XV/cQbBvjrnXEfgA8N/wc='
WHERE
key_id = '384f51b44257c54e9610e9a96ee67f7c18d3a869bdb40f3e84cde02a41303f4e'
AND (
token = 'OC6hl4AQmmFqYIhrUi3bl+XV/cQbBvjrnXEfgA8N/wc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)