UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lTIIfyC3l9qZ8b2oeKBWKv0K3IvT2bQB+OT06fafg6o='
WHERE
key_id = '01219252fffac81884be57036e223d9ef9e4e243667d712e847f8ed4be56fd35'
AND (
token = 'lTIIfyC3l9qZ8b2oeKBWKv0K3IvT2bQB+OT06fafg6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)