UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kDlEIoAG2in4nBFPWjl2hUn0X8aDwrgCTymwYnXBkME=' 
WHERE 
  key_id = '15c9bd99dda890f501a633dbfef58c29131f2f640cc982e03fcd11232c88667b' 
  AND (
    token = 'kDlEIoAG2in4nBFPWjl2hUn0X8aDwrgCTymwYnXBkME=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00221