UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cz51O88it61DKdmJOPtTqMSIoO1b9hz4zfd9/SmGCIU=' 
WHERE 
  key_id = 'd328cd002b4bf479cfc1159eb4fa2f9485b4ad7525ea7a0950524e7db131e622' 
  AND (
    token = 'Cz51O88it61DKdmJOPtTqMSIoO1b9hz4zfd9/SmGCIU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038