UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FxwsMHChSQEyDT7V7+ExQKX8awM4Ru3Pz93p12r2X5c='
WHERE
key_id = 'b73584396700560bff88aee35ea4b54b03217ccc4e7b9294e9b2db3fb2b58cd4'
AND (
token = 'FxwsMHChSQEyDT7V7+ExQKX8awM4Ru3Pz93p12r2X5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)