UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y52uIwwjZuOEThReJt5bCTQjh0b/f19OptkzWbaqwCA=' 
WHERE 
  key_id = '0a96c80f3c4adf45cd4aed62e14786422b0a2cd890723294097be6d79cd54d9c' 
  AND (
    token = 'y52uIwwjZuOEThReJt5bCTQjh0b/f19OptkzWbaqwCA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024