UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zWn9gI1FzpYwv5QT3miUUEx4St66T01++ic1BZMmE1k='
WHERE
key_id = '1e1246773add97e0d1cbb3b6288d30f4c0d28284d8c547c2244c14f564cfc598'
AND (
token = 'zWn9gI1FzpYwv5QT3miUUEx4St66T01++ic1BZMmE1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)