UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'e/D1Hea41SF459QV42h904Y/s1Ts316Fp2GzmhqcPdU=' 
WHERE 
  key_id = '5114bd3fd69b2e030c02999b34f5d78bffbb6bb4dc517cd5ab50ad97393e5be1' 
  AND (
    token = 'e/D1Hea41SF459QV42h904Y/s1Ts316Fp2GzmhqcPdU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019