UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dIJP9iHV9059NR0FDodpN9UASnlDLQxOtdZHLsnOUlk=' 
WHERE 
  key_id = 'b680d024b4d61eba01ab03f2d81b6923310cd344f3f3f6f56df1e348cde997ca' 
  AND (
    token = 'dIJP9iHV9059NR0FDodpN9UASnlDLQxOtdZHLsnOUlk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061