UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ofHhqEzfrV7ETCfqAb/dD+/JJWp61nOreJYf9pBmWuI='
WHERE
key_id = '034d41d68c3f3a7c8ad887eb5c780ab9008d42cd84cfc0a1a1ba8e8546ea2159'
AND (
token = 'ofHhqEzfrV7ETCfqAb/dD+/JJWp61nOreJYf9pBmWuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)