UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2s8NBEqhurKGgbDYSYMmGHRQ1dk3M5o2VR7tk5njO+k='
WHERE
key_id = 'cc89a7761f53cb5a5b82bc53fc65aa48b8d3076cc91c9622a716d68b467b7f5d'
AND (
token = '2s8NBEqhurKGgbDYSYMmGHRQ1dk3M5o2VR7tk5njO+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)