UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f3jo0WbO57Keudo5gWHCplXeTT0oBIy1UpdJZ04K3Q0='
WHERE
key_id = '199a429faf5b1081641ce82cf865d4ae1e34214c4fdfa37f44ea7a25a4b1d666'
AND (
token = 'f3jo0WbO57Keudo5gWHCplXeTT0oBIy1UpdJZ04K3Q0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)