UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CZd9eh4ugeURnYD8S9sHOC4KNRXsjf7HodKxGrpYEqc=' 
WHERE 
  key_id = '28d38852c8401e9c65b257acc71c87b6f8d3dab169d1c8fc7c8e493eb134290b' 
  AND (
    token = 'CZd9eh4ugeURnYD8S9sHOC4KNRXsjf7HodKxGrpYEqc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031