UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5pGeOLilMn2B8OEQsWtWMu1+BuiW97W6pTgjlz2hXvo=' 
WHERE 
  key_id = '5f14346767d770607b7ad29a7bedd1a066ba61994dacfaf542c69bbb9e392e2c' 
  AND (
    token = '5pGeOLilMn2B8OEQsWtWMu1+BuiW97W6pTgjlz2hXvo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027