UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'stmHp3DPwgao8M8aP5fNUGpiUyoqNRAgHUq2366PdCU=' 
WHERE 
  key_id = '19b8cd8de872baffaec16cbcbfc669838dd2d8e9f05a65c7e4128d78cdd7f150' 
  AND (
    token = 'stmHp3DPwgao8M8aP5fNUGpiUyoqNRAgHUq2366PdCU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051