UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D0vB3vUpky6cNLWTX8uBAUM0tOQwR3CpWmsdryMZYrk=' 
WHERE 
  key_id = '4f14aaa77c8ad1e825b901febe93a732192c864bec4c8ca2543fdbf0b2466406' 
  AND (
    token = 'D0vB3vUpky6cNLWTX8uBAUM0tOQwR3CpWmsdryMZYrk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041