UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WoZjuV/fM1tFpt+8LHYPUDiP26GfbeDHRpQ7KsiJpxI=' 
WHERE 
  key_id = 'a352b82291f217688c392e671cae82747648f3cb7df61b1125e04349c180ad33' 
  AND (
    token = 'WoZjuV/fM1tFpt+8LHYPUDiP26GfbeDHRpQ7KsiJpxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035