UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0fkk4h2jcWbmA++2f79FNO/oezEHIdNiGfR12VS++4w='
WHERE
key_id = '3adae44b3df5cb924001a1c39b8abbb1636d80deb922bbf517db92aeb2ffac91'
AND (
token = '0fkk4h2jcWbmA++2f79FNO/oezEHIdNiGfR12VS++4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)