UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kAfbBWlkDUmYy90c+fM5v+UXQze7boJ68q8fHxi81Ww='
WHERE
key_id = 'f06ebaaa5b4b471caf5fbc806e3dbf633df7cd76c73694cddd77e39a22f62226'
AND (
token = 'kAfbBWlkDUmYy90c+fM5v+UXQze7boJ68q8fHxi81Ww='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)